package com.test.test1;

import java.lang.reflect.Proxy;

public class ProxyDemo {
    public static void main(String[] args) {
        HelloImpl hello = new HelloImpl();
        HelloInvocationHandler helloInvocationHandler = new HelloInvocationHandler(hello);
        Hello hello1 = (Hello) Proxy.newProxyInstance(hello.getClass().getClassLoader(), hello.getClass().getInterfaces(), helloInvocationHandler);
        hello1.sayHello("world");


    }
}
